/**************************
* @Summary
* @Author 20009200303 赵传博
* @Date 2022/5/22
*****************************/

#include "Complex.h"



inline Complex &Complex::operator+=(const Complex& other) {
    this->real += other.real;
    this->imagine += other.imagine;
    return *this;
}

ostream &operator<<(ostream &os, Complex &c) {
    os << '(' << c.real << ',' << c.imagine << ')';
    return os;
}

Complex &Complex::operator-=(const Complex& other) {
    this->real -= other.real;
    this->imagine -= other.imagine;
    return *this;
}

Complex &Complex::operator-() {
    auto* res = new Complex(*this);
    res->real = -(this->real);
    res->imagine = -(this->imagine);
    return *res;
}

Complex::Complex(double re, double im):real(re), imagine(im) {}

Complex operator+(Complex a, Complex b){
    Complex res = a;
    return res += b;
}


Complex operator-(Complex &a, const Complex &b){
    Complex res = a;
    return res -= b;
}

